import RcTabs from 'rc-tabs';
import ScrollableInkTabBar from 'rc-tabs/lib/ScrollableInkTabBar';
import TabContent from 'rc-tabs/lib/TabContent';
import React from 'react';

export interface ITabsProps {
  /**
   * tab切换后回调
   */
  onChange?: (key: string) => void;
  activeKey?: string;
  /**
   * 如果 activeKey 不存在时，使用defaultActiveKey
   */
  defaultActiveKey?: string;
}

export default class Tabs extends React.Component<ITabsProps> {
  public render() {
    return (
      <RcTabs
        {...this.props}
        renderTabBar={() => <ScrollableInkTabBar />}
        renderTabContent={() => <TabContent />}
      />
    );
  }
}
